import { NgModule } from '@angular/core';
import { SharedModule } from 'src/app/shared/shared.module';

import { Routes, RouterModule } from '@angular/router';

// 导入 ngx-echarts
import { NgxEchartsModule } from 'ngx-echarts';

import { ProjectComponent } from './pages/project.component';
import { ProjectDashboardComponent } from './pages/project-dashboard/project-dashboard.component';
import { ProjectListComponent } from './pages/project-list/project-list.component';
import { ProjectDetailComponent } from './pages/project-detail/project-detail.component';

import { JarListComponent } from './pages/jar-list/jar-list.component';
import { CveListComponent } from './pages/cve-list/cve-list.component';
import { LicenseListComponent } from './pages/license-list/license-list.component';
import { AddProjectComponent } from './pages/project-list/add-project/add-project.component';
import { AddAppComponent } from './pages/project-list/add-app/add-app.component';


// 路由配置
const routes: Routes = [
  {
    // 一级路由
    path: '', component: ProjectComponent,
    // 二级路由
    children: [
      // { path: '', component: ProjectDashboardComponent },
      // { path: 'project-dashboard', component: ProjectDashboardComponent },
      {
        path: '', component: ProjectListComponent,
        data: { breadcrumb: '项目列表' }
      },
      {
        path: 'project-list', component: ProjectListComponent,
        data: { breadcrumb: '项目列表' }
      },
      {
        path: 'project-detail', component: ProjectDetailComponent,
        data: { breadcrumb: '项目详情' }
      },

      {
        path: 'jar-list', component: JarListComponent,
        data: { breadcrumb: '组件列表' }
      },
      {
        path: 'cve-list', component: CveListComponent,
        data: { breadcrumb: 'cve列表' }
      },
      {
        path: 'license-list', component: LicenseListComponent,
        data: { breadcrumb: 'license列表' }
      },
    ]
  },
];

@NgModule({
  imports: [
    SharedModule,
    RouterModule.forChild(routes),
    NgxEchartsModule
  ],
  declarations: [
    ProjectComponent,
    ProjectDashboardComponent,
    JarListComponent,
    CveListComponent,
    LicenseListComponent,
    ProjectListComponent,
    ProjectDetailComponent,
    AddProjectComponent,
    AddAppComponent
  ],
  entryComponents: [
    AddProjectComponent,
    AddAppComponent
  ]
})
export class ProjectModule { }
